package com.ruoyi.merchant.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.merchant.mapper.MerchantPlatformCouponMapper;
import com.ruoyi.merchant.domain.MerchantPlatformCoupon;
import com.ruoyi.merchant.service.IMerchantPlatformCouponService;

/**
 * 优惠券套餐Service业务层处理
 * 
 * @author dongdong
 * @date 2025-10-22
 */
@Service
public class MerchantPlatformCouponServiceImpl implements IMerchantPlatformCouponService 
{
    @Autowired
    private MerchantPlatformCouponMapper merchantPlatformCouponMapper;

    /**
     * 查询优惠券套餐
     * 
     * @param id 优惠券套餐主键
     * @return 优惠券套餐
     */
    @Override
    public MerchantPlatformCoupon selectMerchantPlatformCouponById(Long id)
    {
        return merchantPlatformCouponMapper.selectMerchantPlatformCouponById(id);
    }

    /**
     * 查询优惠券套餐列表
     * 
     * @param merchantPlatformCoupon 优惠券套餐
     * @return 优惠券套餐
     */
    @Override
    public List<MerchantPlatformCoupon> selectMerchantPlatformCouponList(MerchantPlatformCoupon merchantPlatformCoupon)
    {
        return merchantPlatformCouponMapper.selectMerchantPlatformCouponList(merchantPlatformCoupon);
    }

    /**
     * 新增优惠券套餐
     * 
     * @param merchantPlatformCoupon 优惠券套餐
     * @return 结果
     */
    @Override
    public int insertMerchantPlatformCoupon(MerchantPlatformCoupon merchantPlatformCoupon)
    {
        merchantPlatformCoupon.setCreateTime(DateUtils.getNowDate());
        return merchantPlatformCouponMapper.insertMerchantPlatformCoupon(merchantPlatformCoupon);
    }

    /**
     * 修改优惠券套餐
     * 
     * @param merchantPlatformCoupon 优惠券套餐
     * @return 结果
     */
    @Override
    public int updateMerchantPlatformCoupon(MerchantPlatformCoupon merchantPlatformCoupon)
    {
        merchantPlatformCoupon.setUpdateTime(DateUtils.getNowDate());
        return merchantPlatformCouponMapper.updateMerchantPlatformCoupon(merchantPlatformCoupon);
    }

    /**
     * 批量删除优惠券套餐
     * 
     * @param ids 需要删除的优惠券套餐主键
     * @return 结果
     */
    @Override
    public int deleteMerchantPlatformCouponByIds(Long[] ids)
    {
        return merchantPlatformCouponMapper.deleteMerchantPlatformCouponByIds(ids);
    }

    /**
     * 删除优惠券套餐信息
     * 
     * @param id 优惠券套餐主键
     * @return 结果
     */
    @Override
    public int deleteMerchantPlatformCouponById(Long id)
    {
        return merchantPlatformCouponMapper.deleteMerchantPlatformCouponById(id);
    }
}
